﻿<!-- "script/apps/Aries/Creator/Game/Tasks/ParacraftLearningRoom/ParacraftLearningRoomDailyPage.html" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
<pe:mcml>
<script refresh="true" type="text/npl" src="ParacraftLearningRoomDailyPage.lua"><![CDATA[
local KeepWorkItemManager = NPL.load("(gl)script/apps/Aries/Creator/HttpAPI/KeepWorkItemManager.lua");
local ParacraftLearningRoomDailyPage = NPL.load("(gl)script/apps/Aries/Creator/Game/Tasks/ParacraftLearningRoom/ParacraftLearningRoomDailyPage.lua");
ParacraftLearningRoomDailyPage.OnInit()
function ClosePage()
    Page:CloseWindow();
end
function DS_Items(index)
    if(index == nil) then
        return #ParacraftLearningRoomDailyPage.Current_Item_DS;
    else
        return ParacraftLearningRoomDailyPage.Current_Item_DS[index];
    end
end

function IsNextDay(index)
    return ParacraftLearningRoomDailyPage.IsNextDay(index);
end

function IsFuture(index)
    return ParacraftLearningRoomDailyPage.IsFuture(index);
end

function HasCheckedToday()
    return ParacraftLearningRoomDailyPage.HasCheckedToday();
end
function SaveToLocal()
    ParacraftLearningRoomDailyPage.SaveToLocal();
end
function OnCheck()
    ParacraftLearningRoomDailyPage.OnCheck();
end
function OnOpenWeb(index)
	ParacraftLearningRoomDailyPage.ClosePage();
    ParacraftLearningRoomDailyPage.OnOpenWeb(index,true);
end


function OnVIP()
    if(ParacraftLearningRoomDailyPage.IsVip())then
	    --ParaGlobal.ShellExecute("open", "explorer.exe", "https://keepwork.com/vip", "", 1); 
        _guihelper.MessageBox(L"你已经是Paracraft会员。");
        return
    end
    ParacraftLearningRoomDailyPage.OnVIP()
end

function GetTip()
    local gsid = 998;
    local template = KeepWorkItemManager.GetItemTemplate(gsid);
    local s = string.format(L"点击下方[签到]按钮完成今日签到，每日可按顺序签到一次并获得4个%s，签到成功后可观看当日学习视频。可以点击列表项目重复观看已签到视频，VIP用户可提前观看未签到视频。",template.name);
    return s;
end
function GetExchangePoints()
    local gsid = 998;
    local template = KeepWorkItemManager.GetItemTemplate(gsid);
    local bHas,guid,bagid,copies = KeepWorkItemManager.HasGSItem(gsid)
    copies = copies or 0;
    local s = string.format("%s:%d",template.name, copies);
    return s;
end
function GetDays()
    local copies = ParacraftLearningRoomDailyPage.copies or 0;
    local s = string.format(L"已完成:%d天",copies);
    return s;
end
function GetTitle(index)
    return ParacraftLearningRoomDailyPage.GetTitle(index);
end
local maxCharCount = 12;
function GetLabel(index)
    local title = string.format(L"%d.%s",index, ParacraftLearningRoomDailyPage.lessons_title[index] or "");
    local len = ParaMisc.GetUnicodeCharNum(title);
    if(len >= maxCharCount)then
	    title = ParaMisc.UniSubString(title, 1, maxCharCount-2) or "";
        return title .. "...";
    else
        return title;
    end
end
function OnCheckinToday()
    GameLogic.GetFilters():apply_filters("service.session.add_rice", "growup");
    ParacraftLearningRoomDailyPage.OnCheckinToday();
end
]]></script>
    <aries:window mode="thin" width="600" height="500" title='<%= L"高手成长日记"%>' onclose="ClosePage">
        <div style="height:120px;">
            <!--black background-->
            <div style="position:relative;margin-left:-2px;margin-top:2px;width:595px;height:117px;background-color:#000000;"></div>
            <div style="margin-left:50px;margin-top:20px;color:#ffffff;">
                <div><%=L"由行业专家精心准备的每日编程技巧，学会这些，你也是高手！"%></div>
                <div><%=L'完成"每日成长"便可获得知识豆，用来兑换丰富的奖品。'%></div>
                <div style="margin-top: 25px;"><%=L'*至少需要观看20秒才可获得奖励'%></div>
                
                <!--<div>
                    <div style="float:left"><%=L"Paracraft会员，不受每日一个的数量限制，可提前浏览全部内容"%></div>
                    <div style="float:left;margin-left:5px;margin-top:-5px;"><input type="button"  value='<%=L"马上开通"%>' style="width:85px;height:30px;color:#ffffff;background:url(Texture/Aries/Creator/keepwork/LearningDailyCheck/orange_bg_32bits.png:6 6 6 6);" onclick="OnVIP" /></div>
                </div>-->
            </div>
            <!-- <div style="margin-left:440px;margin-top:20px;color:#ffffff;">
                <div style="float:left;width:30px;height:15px;" >
                    <kp:item gsid="998" style="margin-left:-20px;margin-top:-5px;width:64px;height:32px;"/>
                </div>
                <div style="float:left;margin-left:2px;color:#ffffff;"><%=GetExchangePoints()%></div>
            </div> -->
            
        </div>
        <div style="margin-left:-4px;width:598px;height:50px;color:#ffffff;background-color:#585858;" >
            <div style="margin-top:15px;">
                <div style="float:left;width:300px;padding-left:10px;">
                    <%=GetDays()%>
                </div>
                <!--<div style="float:left;">
                    <div style="float:left;margin-top:5px;width:18px;height:18px;background:url(Texture/Aries/Creator/keepwork/LearningDailyCheck/checked_32bits.png#0 0 18 18);"></div>
                    <div style="float:left;margin-left:5px;">已完成</div>
                    <div style="float:left;margin-left:5px;">|</div>
                    <div style="float:left;margin-left:5px;margin-top:2px;width:20px;height:20px;background:url(Texture/Aries/Creator/keepwork/LearningDailyCheck/vip_32bits.png#0 0 20 20);"></div>
                    <div style="float:left;margin-left:5px;">会员可见</div>
                    <div style="float:left;margin-left:10px;margin-top:-5px;"></div>
                </div>-->
            </div>
            
        </div>
        <div >
            <!--black background-->
            <div style="position:relative;margin-left:-2px;margin-top:2px;width:595px;height:295px;background-color:#000000;"></div>
            <pe:gridview style="margin-left:10px;width:600px;height:400px;" name="item_gridview" CellPadding="10" VerticalScrollBarStep="36" VerticalScrollBarOffsetX="8" AllowPaging="false" ItemsPerLine="5" DefaultNodeHeight = "100" 
                DataSource='<%=DS_Items%>'>
	            <Columns>
                            <div style="width:100px;height:100px;padding-left:15px;">

                                <pe:if condition='<%= IsFuture(Eval("index")) %>'>
                                    <input type="button" name='<%= Eval("index")%>' style="margin-top:2px;width:60px;height:57px;color:#ffffff;background:url(Texture/Aries/Creator/keepwork/LearningDailyCheck/play_gray2_32bits.png#0 0 60 57);" tooltip='<%=GetTitle(Eval("index"))%>' onclick="OnOpenWeb" />
                                    <div style="position:relative;margin-left:-15px;width:90px;height:60px;color:#7a7a7a;">
                                        <div style="text-align:center;">
                                             <%= GetLabel(Eval("index"))%>
                                        </div>
                                    </div>
                                </pe:if>
                                <pe:if condition='<%= not IsFuture(Eval("index")) %>'>
                                    <pe:if condition='<%= IsNextDay(Eval("index")) %>'>
                                        <pe:if condition='<%= HasCheckedToday(Eval("index")) %>'>
                                            <input type="button" name='<%= Eval("index")%>' style="width:64px;height:64px;background:url(Texture/Aries/Creator/keepwork/LearningDailyCheck/xuexiwancheng_64X64_32bits.png);" tooltip='<%=GetTitle(Eval("index"))%>' onclick="OnOpenWeb"  />
                                            <div style="position:relative;margin-left:-15px;margin-top:-3px;width:90px;height:60px;color:#7a7a7a;">
                                                <div style="text-align:center;">
                                                    <!--<%= L"签到成功" %>-->
                                                    <%= GetLabel(Eval("index"))%>
                                                </div>
                                            </div>
                                            
                                        </pe:if>
                                        <pe:if condition='<%= not HasCheckedToday(Eval("index")) %>'>
                                           <input type="button" name='<%= Eval("index")%>' style="width:64px;height:64px;color:#e67300;background:url(Texture/Aries/Creator/keepwork/LearningDailyCheck/play_yellow_32bits.png);" tooltip='<%=GetTitle(Eval("index"))%>' onclick="OnCheckinToday"  />
                                            <div style="position:relative;margin-left:-15px;margin-top:-3px;width:90px;height:60px;color:#7a7a7a;">
                                                <div zorder="101" style="margin-top:0px;text-align:center;">
                                                    <!--<%= L"点击签到" %>-->
                                                    <%= GetLabel(Eval("index"))%>
                                                </div>
                                            </div>
                                            <!--fire practices-->
                                            <div style="position:relative;margin-left:-5px;margin-top:-70px;width:70px;height:70px;background:" >
                                                <img uiname="checkin_animator" zorder="100" enabled="false" class="animated_btn_overlay" width="70" height="70"/>
                                            </div>     
                                        </pe:if>
                                    </pe:if>
                                    <pe:if condition='<%= not IsNextDay(Eval("index")) %>'>
                                        <input type="button" name='<%= Eval("index")%>' style="width:70px;height:61px;color:#ffffff;background:url(Texture/Aries/Creator/keepwork/LearningDailyCheck/play_green_32bits.png#0 0 70 60);" tooltip='<%=GetTitle(Eval("index"))%>' onclick="OnOpenWeb"  />
                                         <div style="position:relative;margin-left:-15px;width:90px;height:60px;color:#7a7a7a;">
                                            <div style="text-align:center;">
                                                <%= GetLabel(Eval("index"))%>
                                            </div>
                                        </div>
                                    </pe:if>
                                </pe:if>
                                
                            </div>
                            
                </Columns>
	            <EmptyDataTemplate>
	            </EmptyDataTemplate>
            </pe:gridview>
        </div>
    </div>
    
</aries:window>
</pe:mcml>
</body>
</html>

